package crm;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.apache.commons.codec.binary.Base64;
 
public class MD5Encode {
	/**
	 * 请根据此加密算法写出 PasswordUtil的md5Encrypt方法
	 * @see utils.PasswordUtil
	 * @param args
	 * @throws NoSuchAlgorithmException
	 */
	public static void main(String[] args) throws NoSuchAlgorithmException {
		String srcPasswd="123456"; //明文密码
		MessageDigest	mDigest = MessageDigest.getInstance("MD5");
		mDigest.update(srcPasswd.getBytes());
		String dstPasswd=Base64.encodeBase64String(mDigest.digest()); //密文密码
		System.out.println(dstPasswd);
	}
}
